package com.pointmi.transactiondao;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.pointmi.customeraccountdao.Customer;
import com.pointmi.merchantdao.Merchant;

@Entity(name="transaction")
public class Transaction implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column
	private String transactionId;
	
	@Column
	private String customerId;
	
	@Column
	private double transactionAmount;
	
	@Column(name="stationId")
	private int merchantId;
	
	@ManyToOne
	@JoinColumn(name="customerId",insertable=false, updatable=false)
	private Customer customer;
	
	@ManyToOne
	@JoinColumn(name="customerId",insertable=false, updatable=false)
	private Merchant merchant;
	
	public void setTransactionId(String transactionId)
	{
		this.transactionId = transactionId;
	}
	
	public String getTransactionId()
	{
		return transactionId;
	}
	
	public void setCustomerId(String customerId)
	{
		this.customerId = customerId;
	}
	
	public String getCustomerId()
	{
		return customerId;
	}
	
	public void setTransactionAmount(double transactionAmount)
	{
		this.transactionAmount = transactionAmount;
	}
	
	public double getTransactionAmount()
	{
		return transactionAmount;
	}
	
	public void setMerchantId(int merchantId)
	{
		this.merchantId = merchantId;
	}
	
	public int getMerchantId()
	{
		return merchantId;
	}
	
	public Customer getCustomer()
	{
		return customer;
	}
	
	public Merchant getMerchant()
	{
		return merchant;
	}
}
